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

52 lines
1.2 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:
2021-09-24 14:01:35 +08:00
fail-fast: false
2021-09-24 13:41:21 +08:00
matrix:
tag:
- alpine-desktopbase
- alpine-slim
- debian-node
2021-11-16 21:41:51 +08:00
- fm
2021-09-24 13:41:21 +08:00
- fedora
- fedora-desktopbase
- fedora-go
- fedora-pwn
- fedora-rust
2021-09-24 14:21:15 +08:00
- ubuntu
2021-09-24 13:41:21 +08:00
- 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' }}
2021-09-24 13:51:34 +08:00
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ matrix.tag }}
2021-09-24 13:41:21 +08:00
labels: ${{ steps.meta.outputs.labels }}