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