@@ -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
+ permissions :
39
+ contents : ' read'
40
+ id-token : ' write'
41
+
42
+ env :
43
+ IMAGE_NAME : ' hexdocs'
44
+ PROJECT_ID : ' hexpm-prod'
45
+ SERVICE_ACCOUNT : ${{ secrets.GCLOUD_SERVICE_ACCOUNT }}
46
+ WORKLOAD_IDENTITY_PROVIDER : ${{ secrets.GCLOUD_WORKFLOW_IDENTITY_POOL_PROVIDER }}
47
+
48
+ steps :
49
+ - uses : actions/checkout@v4
50
+
51
+ - name : Set short git commit SHA
52
+ id : vars
53
+ run : |
54
+ calculatedSha=$(git rev-parse --short ${{ github.sha }})
55
+ echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
56
+
57
+ - name : Set up Docker Buildx
58
+ uses : docker/setup-buildx-action@v3
59
+
60
+ - name : Google auth
61
+ id : auth
62
+ uses : ' google-github-actions/auth@v2'
63
+ with :
64
+ token_format : ' access_token'
65
+ project_id : ${{ env.PROJECT_ID }}
66
+ service_account : ${{ env.SERVICE_ACCOUNT }}
67
+ workload_identity_provider : ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
68
+
69
+ - name : Docker Auth
70
+ id : docker-auth
71
+ uses : ' docker/login-action@v1'
72
+ with :
73
+ registry : gcr.io
74
+ username : ' oauth2accesstoken'
75
+ password : ' ${{ steps.auth.outputs.access_token }}'
76
+
77
+ - name : Build and push
78
+ uses : docker/build-push-action@v6
79
+ with :
80
+ push : ${{ github.event_name != 'pull_request' }}
81
+ tags : gcr.io/${{ env.PROJECT_ID }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHORT_SHA }}
0 commit comments