-
-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (46 loc) · 1.57 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ release ]
workflow_dispatch:
jobs:
test:
name: "Test"
uses: "./.github/workflows/integration-tests.yml"
build:
name: "Build & Publish"
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Set Version
run: |
CI_VERSION=$(cat ./src/VERSION)
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
- name: Build the Docker image
run: docker build . --file Dockerfile -t shrihariprakash/liquid:$CI_VERSION -t "shrihariprakash/liquid:latest" -t ghcr.io/shrihari-prakash/liquid:$CI_VERSION -t "ghcr.io/shrihari-prakash/liquid:latest"
- name: Docker Hub Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Hub Push
run: docker push shrihariprakash/liquid --all-tags
- name: GHCR Login
run: docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} -p ${{ secrets.GHCR_TOKEN }}
- name: GHCR Push Latest
run: docker push ghcr.io/shrihari-prakash/liquid:latest
- name: GHCR Push Version
run: docker push ghcr.io/shrihari-prakash/liquid:$CI_VERSION
acceptance_tests:
name: "Run Acceptance Tests"
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.ACCEPTANCE_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'gopalcs1988',
repo: 'liquid-acceptance-tests',
workflow_id: 'main.yml',
ref: 'main'
})