|
6 | 6 | test:
|
7 | 7 | env:
|
8 | 8 | MIX_ENV: test
|
9 |
| - runs-on: ubuntu-20.04 |
| 9 | + runs-on: ubuntu-24.04 |
10 | 10 | steps:
|
11 | 11 | - uses: actions/checkout@v2
|
12 | 12 |
|
13 | 13 | - uses: erlef/setup-beam@v1
|
14 | 14 | with:
|
15 | 15 | otp-version: 27.2
|
16 |
| - elixir-version: 1.17.3 |
| 16 | + elixir-version: 1.18.1 |
17 | 17 |
|
18 | 18 | - run: mix deps.get
|
19 | 19 | - run: mix format --check-formatted
|
20 | 20 | - run: mix deps.unlock --check-unused
|
21 | 21 | - run: MIX_ENV=test mix compile --warnings-as-errors
|
22 | 22 | - run: mix test
|
| 23 | + |
| 24 | + docker: |
| 25 | + name: Docker |
| 26 | + runs-on: ubuntu-24.04 |
| 27 | + |
| 28 | + permissions: |
| 29 | + contents: 'read' |
| 30 | + id-token: 'write' |
| 31 | + |
| 32 | + env: |
| 33 | + IMAGE_NAME: 'diff' |
| 34 | + PROJECT_ID: 'hexpm-prod' |
| 35 | + SERVICE_ACCOUNT: ${{ secrets.GCLOUD_SERVICE_ACCOUNT }} |
| 36 | + WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCLOUD_WORKFLOW_IDENTITY_POOL_PROVIDER }} |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Set short git commit SHA |
| 42 | + id: vars |
| 43 | + run: | |
| 44 | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) |
| 45 | + echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV |
| 46 | +
|
| 47 | + - name: Set up Docker Buildx |
| 48 | + uses: docker/setup-buildx-action@v3 |
| 49 | + |
| 50 | + - name: Google auth |
| 51 | + id: auth |
| 52 | + uses: 'google-github-actions/auth@v2' |
| 53 | + if: ${{ github.event_name != 'pull_request' }} |
| 54 | + with: |
| 55 | + token_format: 'access_token' |
| 56 | + project_id: ${{ env.PROJECT_ID }} |
| 57 | + service_account: ${{ env.SERVICE_ACCOUNT }} |
| 58 | + workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} |
| 59 | + |
| 60 | + - name: Docker Auth |
| 61 | + id: docker-auth |
| 62 | + uses: 'docker/login-action@v3' |
| 63 | + if: ${{ github.event_name != 'pull_request' }} |
| 64 | + with: |
| 65 | + registry: gcr.io |
| 66 | + username: 'oauth2accesstoken' |
| 67 | + password: '${{ steps.auth.outputs.access_token }}' |
| 68 | + |
| 69 | + - name: Build and push |
| 70 | + uses: docker/build-push-action@v6 |
| 71 | + with: |
| 72 | + tags: gcr.io/${{ env.PROJECT_ID }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHORT_SHA }} |
| 73 | + push: ${{ github.event_name != 'pull_request' }} |
| 74 | + cache-from: type=gha |
| 75 | + cache-to: type=gha,mode=max |
0 commit comments