This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
update docker-publish.yml #2
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
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: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.DOCKER_IMAGE_TAG }} |