1
0
Fork 0
env/.github/workflows/docker-publish.yml

50 lines
1.1 KiB
YAML
Raw Normal View History

2021-09-24 13:45:08 +08:00
name: publish docker images
2021-09-24 13:41:21 +08:00
on:
push:
branches:
- main
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
tag:
- alpine-desktopbase
- alpine-slim
- debian-node
- fedora
- fedora-desktopbase
- fedora-go
- fedora-pwn
- fedora-rust
- ubuntu-desktopbase
steps:
- uses: actions/checkout@v2
- name: log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push Docker image
uses: docker/build-push-action@v2
with:
file: .docker/${{ matrix.tag }}
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ matrix.tag }}
labels: ${{ steps.meta.outputs.labels }}