4
4
push :
5
5
branches :
6
6
- main
7
+ tags :
8
+ - v*
7
9
workflow_dispatch :
8
10
9
11
env :
@@ -14,36 +16,40 @@ jobs:
14
16
runs-on : ubuntu-latest
15
17
16
18
steps :
17
- - name : Checkout repository
18
- uses : actions/checkout@v2
19
-
20
- - name : Login to GitHub Container Registry
21
- uses : docker/login-action@v3
22
- with :
23
- registry : ghcr.io
24
- username : ${{ github.actor }}
25
- password : ${{ secrets.GITHUB_TOKEN }}
26
-
27
- - name : Cache cargo bin
28
- id : cache-cargo
29
- uses : actions/cache@v3
30
- env :
31
- cache-name : cache-cargo-bin
32
- with :
33
- path : ~/.cargo/bin
34
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/install.sh') }}
35
- restore-keys : |
36
- ${{ runner.os }}-build-${{ env.cache-name }}-
37
- ${{ runner.os }}-build-
38
- ${{ runner.os }}-
39
-
40
- - if : ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
41
- name : Run install script
42
- continue-on-error : false
43
- run : bash scripts/install.sh
44
-
45
- - name : Run build script
46
- run : bash scripts/build.sh
47
-
48
- - name : Run publish script
49
- run : bash scripts/publish.sh
19
+ - name : Checkout repository
20
+ uses : actions/checkout@v2
21
+ - name : Docker meta
22
+ id : meta
23
+ uses : docker/metadata-action@v5
24
+ with :
25
+ images : ghcr.io/${{ github.actor }}/rust-wasi-hello
26
+ - name : Login to GitHub Container Registry
27
+ uses : docker/login-action@v3
28
+ with :
29
+ registry : ghcr.io
30
+ username : ${{ github.actor }}
31
+ password : ${{ secrets.GITHUB_TOKEN }}
32
+
33
+ - name : Cache cargo bin
34
+ id : cache-cargo
35
+ uses : actions/cache@v3
36
+ env :
37
+ cache-name : cache-cargo-bin
38
+ with :
39
+ path : ~/.cargo/bin
40
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/install.sh') }}
41
+ restore-keys : |
42
+ ${{ runner.os }}-build-${{ env.cache-name }}-
43
+ ${{ runner.os }}-build-
44
+ ${{ runner.os }}-
45
+
46
+ - if : ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
47
+ name : Run install script
48
+ continue-on-error : false
49
+ run : bash scripts/install.sh
50
+
51
+ - name : Run build script
52
+ run : bash scripts/build.sh
53
+
54
+ - name : Run publish script
55
+ run : bash scripts/publish.sh ${{ steps.meta.outputs.tags }}
0 commit comments