Skip to content

Commit

Permalink
ci: publish images automatically to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Data5tream committed Jun 26, 2023
1 parent 0192caa commit f4ff0d2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 14 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ci

on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'

jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
name/app
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
14 changes: 0 additions & 14 deletions .github/workflows/latest-docker-image.yml

This file was deleted.

0 comments on commit f4ff0d2

Please sign in to comment.