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 c5a214c commit acb9163
Showing 1 changed file with 35 additions and 14 deletions.
49 changes: 35 additions & 14 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:
build:
name: Build new docker image
if: startsWith(github.event.ref, 'refs/tags/v')

runs-on: ubuntu-latest
permissions:
packages: write

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_template_r
tags: latest,${{ github.ref_name }}
- 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/tool_template_r

- 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 acb9163

Please sign in to comment.