@@ -5,16 +5,16 @@ on: [push, pull_request]
5
5
jobs :
6
6
test :
7
7
name : Test
8
- runs-on : ubuntu-20 .04
8
+ runs-on : ubuntu-24 .04
9
9
10
10
steps :
11
- - uses : actions/checkout@v1
11
+ - uses : actions/checkout@v4
12
12
13
13
- name : Install OTP and Elixir
14
14
uses : erlef/setup-beam@v1
15
15
with :
16
- otp-version : 27.1. 2
17
- elixir-version : 1.17.3
16
+ otp-version : 27.2
17
+ elixir-version : 1.18.1
18
18
19
19
- name : Install dependencies
20
20
run : |
30
30
- name : Run tests
31
31
run : |
32
32
mix test --include typesense
33
+
34
+ docker :
35
+ name : Docker
36
+ runs-on : ubuntu-24.04
37
+
38
+ env :
39
+ IMAGE_NAME : ' hexdocs'
40
+ PROJECT_ID : ' hexpm-prod'
41
+ SERVICE_ACCOUNT : ${{ secrets.GCLOUD_SERVICE_ACCOUNT }}
42
+ WORKLOAD_IDENTITY_PROVIDER : ${{ secrets.GCLOUD_WORKFLOW_IDENTITY_POOL_PROVIDER }}
43
+
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+
47
+ - name : Set short git commit SHA
48
+ id : vars
49
+ run : |
50
+ calculatedSha=$(git rev-parse --short ${{ github.sha }})
51
+ echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
52
+
53
+ - name : Set up Docker Buildx
54
+ uses : docker/setup-buildx-action@v3
55
+
56
+ - name : Google auth
57
+ id : auth
58
+ uses : ' google-github-actions/auth@v2'
59
+ with :
60
+ token_format : ' access_token'
61
+ project_id : ${{ env.PROJECT_ID }}
62
+ service_account : ${{ env.SERVICE_ACCOUNT }}
63
+ workload_identity_provider : ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
64
+
65
+ - name : Docker Auth
66
+ id : docker-auth
67
+ uses : ' docker/login-action@v1'
68
+ with :
69
+ registry : gcr.io
70
+ username : ' oauth2accesstoken'
71
+ password : ' ${{ steps.auth.outputs.access_token }}'
72
+
73
+ - name : Build and push
74
+ uses : docker/build-push-action@v6
75
+ with :
76
+ push : ${{ github.event_name != 'pull_request' }}
77
+ tags : gcr.io/${{ env.PROJECT_ID }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHORT_SHA }}
0 commit comments