-
Notifications
You must be signed in to change notification settings - Fork 111
52 lines (44 loc) · 1.36 KB
/
build-g6vp-images-linux.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
name: Build G6VP Images on Linux
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
paths-ignore:
- 'LICENSE'
- '**.md'
pull_request:
branches:
- master
paths-ignore:
- 'LICENSE'
- '**.md'
concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build-image:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build G6VP Image
run: |
cd ${GITHUB_WORKSPACE}
sudo docker build -t antvis/gi-site:${SHORT_SHA} -f packages/gi-site/docker/website.Dockerfile .
- name: Test Image
run: |
sudo docker run --name gi-site -d --rm -p 7001:7001 antvis/gi-site:${SHORT_SHA}
# any test cases here
- name: Release Image
if: false
env:
docker_username: ${{ secrets.DOCKER_USER }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" --password-stdin
# sudo docker push xxxx