-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |