-
-
Notifications
You must be signed in to change notification settings - Fork 25
59 lines (48 loc) · 1.55 KB
/
build_docker_full.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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"}'