This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
57 lines (53 loc) · 1.63 KB
/
snapshot.yml
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
name: snapshot
on:
push:
branches:
- 2021.3.x*
- 2021.6.x*
- 2021.9.x*
- 2021.12.x*
- 2022.3.x*
- 2022.9.x*
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.OS }}-node-
- run: make dep test
snapshot-docker:
runs-on: ubuntu-latest
needs:
- test
env:
BUILD_VERSION_SHA: ${GITHUB_SHA}
steps:
- run: echo "BUILD_VERSION_REF=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: docker/login-action@v1
if: ${{ !env.ACT }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/login-action@v1
if: ${{ !env.ACT }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
docker build -t ghcr.io/cortezaproject/corteza-webapp-one:${{ env.BUILD_VERSION_SHA }} \
-t ghcr.io/cortezaproject/corteza-webapp-one:${{ env.BUILD_VERSION_REF }} .
if: ${{ !env.ACT }}
- run: docker push ghcr.io/cortezaproject/corteza-webapp-one:${{ env.BUILD_VERSION_SHA }}
if: ${{ !env.ACT }}
- run: docker push ghcr.io/cortezaproject/corteza-webapp-one:${{ env.BUILD_VERSION_REF }}
if: ${{ !env.ACT }}