mirror of
https://github.com/darmiel/yaxc.git
synced 2024-11-10 09:03:00 +08:00
60 lines
No EOL
1.4 KiB
YAML
60 lines
No EOL
1.4 KiB
YAML
name: Deploy to docker hub (v-tag)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
hub:
|
|
name: Push Docker image to Docker Hub
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Login to docker hub
|
|
if: success()
|
|
uses: actions-hub/docker/login@master
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build image
|
|
if: success()
|
|
run: docker build -t ${GITHUB_REPOSITORY}:${IMAGE_TAG} .
|
|
|
|
- name: Push to docker registry
|
|
if: success()
|
|
uses: actions-hub/docker@master
|
|
with:
|
|
args: push ${GITHUB_REPOSITORY}:${IMAGE_TAG}
|
|
|
|
github:
|
|
name: Push Docker image to GitHub Packages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out the repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to GitHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
- name: Push to GitHub Packages
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ghcr.io/darmiel/yaxc:latest
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }} |