fix: change workflow name #43
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
# This is a basic workflow to help you get started with Actions | |
name: Build docker image and prepare deployment | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
codes: ${{ steps.changes.outputs.codes }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
codes: | |
- 'src/**' | |
- 'Dockerfile' | |
- package*.json | |
docker: | |
runs-on: ubuntu-latest | |
if: ${{ needs.changes.outputs.codes == 'true' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: geraldapm/physweb-backend:latest | |
# deploy: | |
# # The type of runner that the job will run on | |
# runs-on: ubuntu-latest | |
# # Steps represent a sequence of tasks that will be executed as part of the job | |
# steps: | |
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
# - uses: actions/checkout@v2 | |
# # Runs a set of commands using the runners shell | |
# - name: Deploy to Alibaba cloud | |
# uses: appleboy/ssh-action@master | |
# with: | |
# host: ${{ secrets.HOST }} | |
# username: ${{ secrets.USERNAME }} | |
# password: ${{ secrets.PASSWORD }} | |
# port: 22 | |
# script: | | |
# pm2 delete all | |
# pm2 reset all | |
# cd /root/ta-undika-backend | |
# git pull origin master | |
# npm install | |
# git stash | |
# npm run start |