-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (43 loc) · 1.34 KB
/
docker-on-release.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
name: Docker Image CI
on:
release:
branches: [ master ]
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Buildx setup
uses: docker/setup-buildx-action@v1
- name: Qemu setup
uses: docker/setup-qemu-action@v1
- name: Set env vars
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Update shash in files
run: |
python dev_tools/update_frontend_version_hash.py
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: test
run: echo "Creating docker image for branch $GIT_BRANCH"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7
push: true
file: docker/Dockerfile
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/sandypi:${{ github.event.release.tag_name }}
${{ secrets.DOCKER_HUB_USERNAME }}/sandypi:latest