Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaelicke authored Feb 16, 2023
1 parent 2a78b14 commit c256d89
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
name: Docker Image CI

on:
release:
types: [published]
on: push

jobs:

build:
name: Build new docker image
if: startsWith(github.event.ref, 'refs/tags/v')

runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: build and push
uses: docker/build-push-action@v1
with:
registry: ghcr.io
username: "vforwater"
password: ${{ secrets.PAT }}
repository: vforwater/tbr_profile
tags: latest,${{ github.ref_name }}
runs-on: ubuntu-latest
permissions:
packages: write

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/vforwater/tbr_profile

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit c256d89

Please sign in to comment.