Use cache to retrieve the changelog #42
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 Docker image (full) | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Wait until PyPI release is available | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
await wait(300000); // Wait for 5 minutes | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
iwatkot/maps4fs:latest | |
iwatkot/maps4fs:${{ github.ref_name }} | |
file: ./Dockerfile | |
build-args: | | |
API_TOKEN=${{ secrets.API_TOKEN }} | |
STATS_HOST=${{ secrets.STATS_HOST }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Wait until Docker image is available | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
await wait(180000); // Wait for 3 minutes | |
- name: Make POST request to redeploy | |
run: | | |
curl -X POST "${{ secrets.REDEPLOY_ENDPOINT }}" \ | |
-H "Authorization: Bearer ${{ secrets.PRIVATE_TOKEN }}" \ | |
-H "Content-Type: application/json" \ | |
-d '{"container_key": "generator"}' |