@@ -22,15 +22,15 @@ jobs:
22
22
restore-keys : |
23
23
${{ runner.os }}-buildx-
24
24
- name : Login to DockerHub
25
- uses : docker/login-action@v1
25
+ uses : docker/login-action@v1
26
26
with :
27
27
username : ${{ secrets.DOCKERHUB_USERNAME }}
28
28
password : ${{ secrets.DOCKERHUB_TOKEN }}
29
29
- name : Get git tag
30
30
run : |
31
31
echo "::set-output name=GIT_TAG::$(git tag --points-at HEAD)"
32
32
id : set_git_vars
33
- - name : Build and push
33
+ - name : Build and push
34
34
uses : docker/build-push-action@v2
35
35
with :
36
36
context : .
39
39
tags : ${{ github.repository }}:${{ steps.set_git_vars.outputs.GIT_TAG }}
40
40
cache-from : type=local,src=/tmp/.buildx-cache
41
41
cache-to : type=local,dest=/tmp/.buildx-cache
42
-
42
+ - name : Push to GitHub Packages
43
+ uses : docker/build-push-action@v2
44
+ with :
45
+ context : .
46
+ file : ./Dockerfile
47
+ push : true
48
+ tags : ghcr.io/${{ github.repository }}:${{ steps.set_git_vars.outputs.GIT_TAG }}
49
+ cache-from : type=local,src=/tmp/.buildx-cache
50
+ cache-to : type=local,dest=/tmp/.buildx-cache
51
+
43
52
deploy :
44
53
needs : [test, build]
45
54
runs-on : ubuntu-latest
55
64
echo "::set-output name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
56
65
echo "::set-output name=TAG::$(git tag --points-at HEAD)"
57
66
echo "::set-output name=GIT_SHA::$(git rev-parse HEAD)"
58
- echo "::set-output name=GIT_SHA_SHORT::$(git rev-parse --short HEAD)"
67
+ echo "::set-output name=GIT_SHA_SHORT::$(git rev-parse --short HEAD)"
59
68
id : extract_variables
60
69
61
70
- name : Checkout terraform config repo
74
83
tar -xzvf dockerize-linux-amd64-v0.6.0.tar.gz
75
84
rm dockerize-linux-amd64-v0.6.0.tar.gz
76
85
./dockerize -template prod-eu-west/services/profiles/_volpino.auto.tfvars.tmpl:prod-eu-west/services/profiles/_volpino.auto.tfvars
77
-
86
+
78
87
git config --local user.email "action@github.com"
79
88
git config --local user.name "GitHub Action"
80
89
git add prod-eu-west/services/profiles/_volpino.auto.tfvars
0 commit comments