added images to public folder #599
This file contains hidden or 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
| # build, publis and deploy an API docker image | |
| name: stage - build, publish & deploy docker image | |
| on: [push] | |
| jobs: | |
| push_to_registry: | |
| name: push docker image to docker hub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: check out the repo | |
| uses: actions/checkout@master | |
| - name: log in to docker hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: extract metadata (tags, labels) for docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: gendercomics/website-stage | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| flavor: | | |
| latest=true | |
| - name: build and push docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ./Dockerfile | |
| build-args: VUE_APP_API_URL=https://api-stage.gendercomics.net/ | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| deploy_stage: | |
| needs: push_to_registry | |
| name: stage deployment to digitalocean.com | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: check out the repo | |
| uses: actions/checkout@master | |
| - name: deploy stage | |
| uses: alinz/ssh-scp-action@master | |
| with: | |
| key: ${{ secrets.DEPLOY_KEY }} | |
| host: ${{ secrets.APP_HOST }} | |
| user: ${{ secrets.DEPLOY_USER }} | |
| # runs this on remove server | |
| ssh_before: | | |
| echo 'STAGE: deploying ${{ github.ref }}' | |
| cd /var/gendercomics/website | |
| ls -lath | |
| # then upload docker-compose.yml | |
| scp: | | |
| ./docker-compose.yml ${{ secrets.DEPLOY_USER }}@${{ secrets.APP_HOST }}:/var/gendercomics/website | |
| # then run these commands | |
| ssh_after: | | |
| echo 'running docker-compose' | |
| docker pull gendercomics/website-stage:latest | |
| cd /var/gendercomics/website | |
| docker-compose up -d gendercomics-website-stage | |
| echo 'DONE!!!' |