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: Docker Image Build and Publish to GitHub Container Registry | |
permissions: write-all | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build & Push | |
run: | | |
docker buildx create --use | |
docker build . --tag ghcr.io/paxo-phone/paxo-site:latest | |
docker push ghcr.io/paxo-phone/paxo-site:latest | |
# - name: Execute update script on remote server | |
# env: | |
# SSH_USERNAME: ${{ secrets.SSH_USERNAME }} | |
# SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} | |
# SSH_HOST: ${{ secrets.SSH_HOST }} | |
# run: | | |
# sudo apt-get update -y | |
# sudo apt-get install -y sshpass | |
# sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_HOST 'sh /home/debian/updatepaxosite.sh' |