Feat: add receive page #38
Workflow file for this run
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: Build and deploy new image | |
concurrency: | |
group: ${{ github.workflow }} | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- 'main' | |
types: | |
- closed | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-docker: | |
if: ${{ github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
deploy-image: | |
runs-on: ubuntu-latest | |
needs: build-docker | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: executing remote ssh commands using ssh key | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
script: | | |
cd ./nova-wallet-web-app | |
echo ${{ secrets.PAT_FOR_DOCKER_REGISTRY }} | docker login ghcr.io -u stepanLav --password-stdin | |
docker-compose down | |
rm .env | |
echo "NEXT_PUBLIC_BOT_API_URL=${{ secrets.NEXT_PUBLIC_BOT_API_URL }}" >> .env | |
echo "NEXT_PUBLIC_BOT_ADDRESS=${{ secrets.NEXT_PUBLIC_BOT_ADDRESS }}" >> .env | |
echo "NEXT_PUBLIC_WEB_APP_ADDRESS=${{ secrets.NEXT_PUBLIC_WEB_APP_ADDRESS }}" >> .env | |
docker-compose pull | |
docker-compose up -d | |
docker image prune -f | |
- name: Notify Telegram channel | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: markdown | |
message: | | |
🖥️ New version for bot web app was deployed! | |
commit: ${{ github.sha }} |