Moved the build to GitHub actions (#2)

This commit is contained in:
2020-12-13 23:07:55 +01:00
committed by GitHub
parent e5b4442656
commit ead5b7993d
6 changed files with 43 additions and 103 deletions

View File

@@ -1,36 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.

41
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: CI to Docker Hub
on:
push:
branches: [ master, github-actions ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
multi:
runs-on: ubuntu-latest
strategy:
matrix:
repository: [restic-auto]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ${{ matrix.repository }}/
file: ${{ matrix.repository }}/Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.repository }}:latest