@@ -35,58 +35,58 @@ jobs:
35
35
echo commit: ${{ github.event.inputs.commit }}
36
36
37
37
publish :
38
- runs-on : ubuntu-latest
39
- if : ${{ github.repository_owner == 'fermyon' }}
40
- env :
41
- OCI_IMAGE_NAME : bartholomew-docs
42
- outputs :
43
- ecr_ref : ${{ steps.login-ecr.outputs.registry }}/${{ env.OCI_IMAGE_NAME }}@${{ steps.push.outputs.digest }}
44
- steps :
45
- - uses : actions/checkout@v3
46
-
47
- - name : Check out specific ref
48
- if : ${{ github.event_name == 'workflow_dispatch' }} && ${{ inputs.ref != ''}}
49
- run : git checkout ${{ inputs.ref }}
50
-
51
- - name : Check out specific commit
52
- if : ${{ github.event_name == 'workflow_dispatch' }} && ${{ inputs.commit != ''}}
53
- run : git checkout ${{ inputs.commit }}
54
-
55
- - name : Construct OCI image tag
56
- shell : bash
57
- run : |
58
- [[ "${{ github.event_name }}" == "push" ]] && \
59
- echo "IMAGE_TAG=latest" >> $GITHUB_ENV || \
60
- echo "IMAGE_TAG=canary" >> $GITHUB_ENV
61
-
62
- - name : Setup Spin
63
- uses : fermyon/actions/spin/setup@v1
64
- with :
65
- github_token : ${{ secrets.GITHUB_TOKEN }}
66
- version : v2.0.1
67
-
68
- - name : Configure AWS Credentials for publishing
69
- uses : aws-actions/configure-aws-credentials@v4
70
- with :
71
- role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_IAM_ROLE }}
72
- role-session-name : ${{ env.OCI_IMAGE_NAME }}
73
- aws-region : ${{ secrets.AWS_REGION }}
74
-
75
- - name : Log in to Amazon ECR
76
- id : login-ecr
77
- uses : aws-actions/amazon-ecr-login@v2
78
-
79
- - name : Publish Spin app
80
- id : push
81
- uses : fermyon/actions/spin/push@v1
82
- with :
83
- registry_reference : ${{ steps.login-ecr.outputs.registry }}/${{ env.OCI_IMAGE_NAME }}:${{ env.IMAGE_TAG }}
84
- manifest_file : docs/spin.toml
85
-
86
- - name : Cleanup login
87
- if : ${{ always() }}
88
- run : |
89
- rm -rf /home/runner/fermyon
38
+ runs-on : ubuntu-latest
39
+ if : ${{ github.repository_owner == 'fermyon' }}
40
+ env :
41
+ OCI_IMAGE_NAME : bartholomew-docs
42
+ outputs :
43
+ ecr_ref : ${{ steps.login-ecr.outputs.registry }}/${{ env.OCI_IMAGE_NAME }}@${{ steps.push.outputs.digest }}
44
+ steps :
45
+ - uses : actions/checkout@v3
46
+
47
+ - name : Check out specific ref
48
+ if : ${{ github.event_name == 'workflow_dispatch' }} && ${{ inputs.ref != ''}}
49
+ run : git checkout ${{ inputs.ref }}
50
+
51
+ - name : Check out specific commit
52
+ if : ${{ github.event_name == 'workflow_dispatch' }} && ${{ inputs.commit != ''}}
53
+ run : git checkout ${{ inputs.commit }}
54
+
55
+ - name : Construct OCI image tag
56
+ shell : bash
57
+ run : |
58
+ [[ "${{ github.event_name }}" == "push" ]] && \
59
+ echo "IMAGE_TAG=latest" >> $GITHUB_ENV || \
60
+ echo "IMAGE_TAG=canary" >> $GITHUB_ENV
61
+
62
+ - name : Setup Spin
63
+ uses : fermyon/actions/spin/setup@v1
64
+ with :
65
+ github_token : ${{ secrets.GITHUB_TOKEN }}
66
+ version : v2.0.1
67
+
68
+ - name : Configure AWS Credentials for publishing
69
+ uses : aws-actions/configure-aws-credentials@v4
70
+ with :
71
+ role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_IAM_ROLE }}
72
+ role-session-name : ${{ env.OCI_IMAGE_NAME }}
73
+ aws-region : ${{ secrets.AWS_REGION }}
74
+
75
+ - name : Log in to Amazon ECR
76
+ id : login-ecr
77
+ uses : aws-actions/amazon-ecr-login@v2
78
+
79
+ - name : Publish Spin app
80
+ id : push
81
+ uses : fermyon/actions/spin/push@v1
82
+ with :
83
+ registry_reference : ${{ steps.login-ecr.outputs.registry }}/${{ env.OCI_IMAGE_NAME }}:${{ env.IMAGE_TAG }}
84
+ manifest_file : docs/spin.toml
85
+
86
+ - name : Cleanup login
87
+ if : ${{ always() }}
88
+ run : |
89
+ rm -rf /home/runner/fermyon
90
90
91
91
deploy :
92
92
runs-on : ubuntu-latest
0 commit comments