-
Notifications
You must be signed in to change notification settings - Fork 25
41 lines (39 loc) · 1.39 KB
/
build.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
name: build images
on:
push:
branches:
- master
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- id: build_args
run: |
echo '::set-output name=BUILD_DATE::$(date +'%Y-%m-%dT%H:%M:%S')'
echo '::set-output name=VERSION::$(head -1 VERSION)'
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
qemu-version: latest
- name: Run Buildx
run: |
DOCKER_IMAGE=osminogin/tor-simple
docker buildx create --use --name build --node build --driver-opt network=host
docker buildx build \
--platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \
--output "type=image,push=true" \
--tag ${DOCKER_IMAGE}:latest \
--tag ${DOCKER_IMAGE}:${{ steps.build_args.outputs.VERSION }} \
--build-arg VERSION=${{ steps.build_args.outputs.VERSION }} \
--build-arg BUILD_DATE=${{ steps.build_args.outputs.BUILD_DATE }} \
--build-arg VCS_REF=${GITHUB_SHA::8} \
.
- name: Inspect Image
run: |
docker buildx imagetools inspect osminogin/tor-simple:latest