Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

[Docker] - volume pour .env #4

[Docker] - volume pour .env

[Docker] - volume pour .env #4

Workflow file for this run

name: Deploy The Archiver
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: ubuntu-latest
env:
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to private registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: "${{ secrets.REGISTRY_URL }}/the-archiver:latest"
- name: Executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_URL }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWD }}
port: ${{ secrets.SERVER_PORT }}
script: |
docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ secrets.REGISTRY_URL }}
docker pull ${{ secrets.REGISTRY_URL }}/the-archiver:latest
docker rm -f the-archiver || true && docker run -d -v ${{ secrets.ENV_FILE }}:/usr/src/app/.env:ro --network infra --name the-archiver ${{ secrets.REGISTRY_URL }}/the-archiver:latest