You've already forked hastebin-ansi
mirror of
https://github.com/armbian/hastebin-ansi.git
synced 2026-01-06 12:30:55 -08:00
GHA workflow to Docker ghcr.io
This commit is contained in:
56
.github/workflows/master-latest.yml
vendored
Normal file
56
.github/workflows/master-latest.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: master-latest
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
#schedule:
|
||||
# - cron: '0 3 * * *' # Scheduled runs every day at 3am UTC
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
#- name: Log in to Docker Hub
|
||||
# uses: docker/login-action@v2
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Docker Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }} # github username or org
|
||||
password: ${{ secrets.GITHUB_TOKEN }} # github actions builtin token. repo has to have pkg access.
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64 #,linux/arm64
|
||||
pull: true # avoid bitrot with repeated cache hits
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository_owner }}/ansi-hastebin:latest
|
||||
labels: |
|
||||
org.opencontainers.image.title=ansi-hastebin
|
||||
org.opencontainers.image.description=${{ github.event.repository.description }}
|
||||
org.opencontainers.image.url=${{ github.event.repository.html_url }}
|
||||
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
|
||||
cache-from: type=gha # all-automatic Github Actions caching
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
Reference in New Issue
Block a user