Build docker image #170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Build docker image' | |
on: | |
# Auto build on push to main branch | |
push: | |
paths-ignore: | |
- “README.md” | |
- ".gitignore" | |
- "LICENSE" | |
branches: | |
- main | |
# Auto build @ every Monday 6:00am | |
schedule: | |
- cron: '0 6 * * 1' | |
jobs: | |
build: | |
name: 'Build docker image' | |
runs-on: ubuntu-latest | |
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
# Checkout the repository to the GitHub Actions runner | |
- name: 'Checkout the repository to the GitHub Actions runner' | |
uses: actions/checkout@v2 | |
# Set up QEMU | |
- name: 'Set up QEMU' | |
uses: docker/setup-qemu-action@v1 | |
# Login to DockerHub with username and token | |
- name: Login to DockerHub with username and token | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Build image and push to DockerHub | |
- name: "Build image and push to DockerHub" | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: sbilly/zerotier-controller:latest | |