This repository has been archived by the owner on Dec 23, 2023. It is now read-only.
Update deploy.yml #46
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: Deploy | |
# concurrency: | |
# group: prod | |
# cancel-in-progress: true | |
# on: | |
# push: | |
# tags: | |
# - 'v*' | |
# env: | |
# REGISTRY: ghcr.io | |
# IMAGE_NAME: ${{ github.repository }} | |
# jobs: | |
# build: | |
# name: Build | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Use Node.js 16.10.0 | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: '16.10.0' | |
# cache: 'npm' | |
# - run: npm ci | |
# - run: npm run build | |
# docker: | |
# name: Build Docker Image | |
# runs-on: ubuntu-latest | |
# needs: [ build ] | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Log in to the Container registry | |
# uses: docker/login-action@v2 | |
# with: | |
# registry: ${{ env.REGISTRY }} | |
# username: ${{ github.actor }} | |
# password: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Extract metadata (tags, labels) for Docker | |
# id: meta | |
# uses: docker/metadata-action@v4 | |
# with: | |
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@v3 | |
# with: | |
# build-args: | | |
# API_URL=${{ secrets.API_URL }} | |
# context: . | |
# push: true | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} | |
# deploy: | |
# name: Deploy | |
# runs-on: ubuntu-latest | |
# environment: Production | |
# needs: [ docker ] | |
# steps: | |
# - name: Deploy package to production | |
# uses: appleboy/ssh-action@v0.1.5 | |
# with: | |
# host: ${{ secrets.SSH_IP }} | |
# username: ${{ secrets.SSH_USER }} | |
# password: ${{ secrets.SSH_PASSWORD }} | |
# script: | | |
# cd web | |
# docker-compose down | |
# docker image rm ghcr.io/newbies-workplace/jeteo-web | |
# docker pull ghcr.io/newbies-workplace/jeteo-web:latest | |
# docker-compose up -d |