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

67 lines
2.0 KiB
YAML
Raw Permalink Normal View History

2021-09-30 11:35:47 -07:00
name: CI/CD
2021-07-05 01:20:27 -07:00
on:
2021-09-30 11:35:47 -07:00
# Triggers the workflow when changes are made to the image on the main branch
2021-07-05 01:20:27 -07:00
push:
branches: [ main ]
paths:
- 'projects/5etools-docker/Dockerfile'
- 'projects/5etools-docker/init.sh'
2021-07-05 01:20:27 -07:00
pull_request:
branches: [ main ]
paths:
- 'projects/5etools-docker/Dockerfile'
- 'projects/5etools-docker/init.sh'
2021-07-05 01:20:27 -07:00
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
2021-09-30 11:35:47 -07:00
ci:
2021-08-01 10:52:36 -07:00
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
tags: |
latest
type=edge
2022-12-01 19:21:19 -08:00
type=sha
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