Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

更新chronocat至0.0.52 #12

更新chronocat至0.0.52

更新chronocat至0.0.52 #12

name: Docker Publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ${{ github.workspace }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Set environment variables
run: |
echo "DOCKER_IMAGE_TAG=yuukinya/chronocat-docker:latest" >> $GITHUB_ENV
- name: Check Dockerfile changes
id: dockerfile-changed
run: |
git diff --quiet HEAD^ -- Dockerfile || echo "::set-output name=changed::true"
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
if: steps.dockerfile-changed.outputs.changed == 'true'
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.DOCKER_IMAGE_TAG }}