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