LittlePaimon/.github/workflows/release_docker.yaml

41 lines
1.1 KiB
YAML
Raw Normal View History

2023-03-09 09:03:49 +08:00
name: Release Docker Image
on:
push:
tags:
- v**
jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Docker Buildx Command
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to docker registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.DOCKER_IMAGE_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get Docker Image Url
id: image
env:
URL: ${{ secrets.DOCKER_IMAGE_REGISTRY }}${{ secrets.DOCKER_IMAGE_PATH }}
run: |
2023-03-09 09:12:56 +08:00
echo LATEST=${URL}:latest >> $GITHUB_OUTPUT
2023-03-09 09:03:49 +08:00
echo VERSION=${URL}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
- name: Build Docker Image and Push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: .
2023-03-09 09:12:56 +08:00
file: ./dockerfile
2023-03-09 09:03:49 +08:00
tags: ${{ steps.image.outputs.VERSION }},${{ steps.image.outputs.LATEST }}