mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1name: build-and-push-link-aws
2on:
3 workflow_dispatch:
4 pull_request:
5 paths:
6 - 'bskylink/**'
7 - 'Dockerfile.bskylink'
8 - '.github/workflows/build-and-push-link-aws.yaml'
9
10env:
11 REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
12 USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }}
13 PASSWORD: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_PASSWORD }}
14 IMAGE_NAME: bskylink
15
16jobs:
17 link-container-aws:
18 if: github.repository == 'bluesky-social/social-app'
19 runs-on: ubuntu-latest
20 permissions:
21 contents: read
22 packages: write
23 id-token: write
24
25 steps:
26 - name: Checkout repository
27 uses: actions/checkout@v3
28
29 - name: Setup Docker buildx
30 uses: docker/setup-buildx-action@v1
31
32 - name: Log into registry ${{ env.REGISTRY }}
33 uses: docker/login-action@v2
34 with:
35 registry: ${{ env.REGISTRY }}
36 username: ${{ env.USERNAME}}
37 password: ${{ env.PASSWORD }}
38
39 - name: Extract Docker metadata
40 id: meta
41 uses: docker/metadata-action@v4
42 with:
43 images: |
44 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45 tags: |
46 type=sha,enable=true,priority=100,prefix=,suffix=,format=long
47
48 - name: Build and push Docker image
49 id: build-and-push
50 uses: docker/build-push-action@v4
51 with:
52 context: .
53 push: true
54 file: ./Dockerfile.bskylink
55 tags: ${{ steps.meta.outputs.tags }}
56 labels: ${{ steps.meta.outputs.labels }}
57 cache-from: type=gha
58 cache-to: type=gha,mode=max