Jafner.net/5etools-docker/.github/workflows/ci.yml

69 lines
2.2 KiB
YAML
Raw Normal View History

2021-07-05 01:20:27 -07:00
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
2021-09-29 11:37:50 -07:00
paths-ignore: # don't run this workflow if no changes have been made to the docker image
- '.github/**'
- 'docker-compose.yml'
2021-07-05 01:20:27 -07:00
pull_request:
branches: [ main ]
2021-09-29 11:37:50 -07:00
paths-ignore: # don't run this workflow if no changes have been made to the docker image
- '.github/**'
- 'docker-compose.yml'
2021-07-05 01:20:27 -07:00
# 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:
2021-08-01 10:52:36 -07:00
push_to_registry:
name: Build and push Docker image to Docker Hub
2021-07-05 01:20:27 -07:00
runs-on: ubuntu-latest
steps:
2021-08-01 10:52:36 -07:00
- name: Check out the repo
uses: actions/checkout@v2
- name: Log into Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: jafner/5etools-docker
2021-08-01 11:00:10 -07:00
tags: latest
2021-08-01 16:15:08 -07:00
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
2021-08-01 10:52:36 -07:00
- name: Build and push the Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
2021-08-01 16:15:08 -07:00
builder: ${{ steps.buildx.outputs.name }}
2021-08-01 16:44:03 -07:00
platforms: linux/amd64,linux/arm64,linux/arm/v7
2021-08-01 10:52:36 -07:00
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: jafner/5etools-docker