Skip to content

[add] 404 NGO page

[add] 404 NGO page #10

# reference:
# 1. https://github.com/docker/build-push-action/blob/master/docs/advanced/push-multi-registries.md
# 2. https://github.com/docker/build-push-action/blob/master/docs/advanced/share-image-jobs.md
name: Deploy to Production environment
on:
push:
tags:
- v*
env:
ARTIFACT_PATH: /tmp/artifact.tar
BOX_NAME: web-server
BOX_URL: idea2app/web-server
jobs:
deploy_docker_image:
name: Deploy Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Inject Environment variables
run: |
echo "BOX_NAME=${BOX_NAME@L}" >> "${GITHUB_ENV}"
echo "BOX_URL=${BOX_URL@L}" >> "${GITHUB_ENV}"
cat > .env.local <<EOF
${{ secrets.ENV_FILE }}
EOF
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Build Image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
tags: ${{ env.BOX_URL }}:latest
outputs: type=docker,dest=${{ env.ARTIFACT_PATH }}
- name: Pick Docker Compose
run: |
mkdir ./build
mv ${{ env.ARTIFACT_PATH }} ./docker-compose.yml ./start.sh ./build
- name: Transport Image
uses: appleboy/[email protected]
with:
source: ./build/*.*
target: /tmp
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.SSH_KEY }}
strip_components: 1
- name: Run Image
uses: garygrossgarten/github-action-ssh@release
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.SSH_KEY }}
command: |
mv /tmp/docker-compose.yml /tmp/start.sh ~/
chmod +x ~/start.sh
echo '${{ secrets.SSH_KEY }}' | sudo -S ~/start.sh ${{ env.ARTIFACT_PATH }}