-
Notifications
You must be signed in to change notification settings - Fork 10
69 lines (59 loc) · 1.79 KB
/
docker-admin.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Docker Image admin
on:
push:
branches: ['**']
paths:
- 'admin/**'
- '.github/workflows/docker-admin.yaml'
workflow_dispatch:
branches: ['**']
jobs:
docker:
runs-on: ubuntu-latest
outputs:
img_tag: ${{ steps.preserve_img_tag.outputs.img_tag }}
steps:
- uses: actions/checkout@master
- name: Setup VARS.js
run: 'printf "$ADMIN_VARS" > admin/js/VARS.js'
env:
ADMIN_VARS: ${{secrets.ADMIN_VARS}}
- name: Compute image tag
run: |
echo "IMG_TAG=$(echo ${GITHUB_SHA} | sed -E 's/refs\/(heads|tags)\///g' | sed -e 's/\//-/g')" >> $GITHUB_ENV
- name: Preserve image tag
id: preserve_img_tag
run: |
echo "img_tag=${{ env.IMG_TAG }}" >> $GITHUB_OUTPUT
- name: Kaniko build
uses: julsemaan/action-kaniko@master
with:
registry: ghcr.io
image: julsemaan/anyfile-notepad/admin
tag: ${{ env.IMG_TAG }}
tag_with_latest: false
password: ${{ secrets.GITHUB_TOKEN }}
path: admin/
extra_args: >-
--push-retry 5
pr_afn_k8s:
needs: docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
repository: julsemaan/afn-k8s
- name: Get IMG_TAG
run: |
echo $IMG_TAG
env:
IMG_TAG: ${{needs.docker.outputs.img_tag}}
- name: Stage changes in new branch
env:
IMG_TAG: ${{needs.docker.outputs.img_tag}}
run: |
git checkout -b tmp/admin-$IMG_TAG
git config --global user.email "devnull@semaan.ca"
git config --global user.name "Semaan Bot"
git commit --allow-empty -a -m "bump admin to $IMG_TAG"
git push origin HEAD