remove(files): remove mail assets #212
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: Building & Deploying Backend | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 16.13.2 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.2 | |
- uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/payments-backend:latest | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
- name: Cleaning remote docker image and container | |
uses: fifsky/ssh-action@master | |
continue-on-error: true | |
with: | |
command: | | |
docker rm $(docker stop $(docker ps -a -q --filter ancestor=${{ secrets.DOCKER_HUB_USERNAME }}/payments-backend --format="{{.ID}}")) && | |
docker rmi ${{ secrets.DOCKER_HUB_USERNAME }}/payments-backend | |
host: ${{ secrets.HOST }} | |
user: ${{ secrets.USERNAME }} | |
pass: ${{ secrets.PASSWORD}} | |
port: ${{ secrets.PORT}} | |
- name: Building and deploying new website | |
uses: fifsky/ssh-action@master | |
with: | |
command: | | |
docker run -d -p 9442:9442 --network host --name payments-backend -e WH_DISCORD_URL=${{ secrets.WH_DISCORD_URL}} -e WH_STRIPE_SECRET=${{ secrets.WH_STRIPE_SECRET}} -e REDMINE_API_KEY=${{ secrets.REDMINE_API_KEY }} -e EMAIL_USERNAME=${{ secrets.EMAIL_USERNAME }} -e EMAIL_PASSWORD=${{ secrets.EMAIL_PASSWORD }} -e EMAIL_HOST=${{ secrets.EMAIL_HOST }} -e EMAIL_PORT=${{ secrets.EMAIL_PORT }} -e REDMINE_URL=http://localhost:9550 -e STRIPE_SK=${{ secrets.STRIPE_SK }} -e APP_URL=https://payments.koders.in -v /home/panther/payments:/usr/src/app/storage ${{ secrets.DOCKER_HUB_USERNAME }}/payments-backend | |
host: ${{ secrets.HOST }} | |
user: ${{ secrets.USERNAME }} | |
pass: ${{ secrets.PASSWORD}} | |
port: ${{ secrets.PORT}} |