-
Notifications
You must be signed in to change notification settings - Fork 4
29 lines (25 loc) · 1013 Bytes
/
deploy.yml
File metadata and controls
29 lines (25 loc) · 1013 Bytes
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
---
name: Deploy Image to registry
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build & Push Image
run: |
docker login ${{ secrets.REGISTRY_ENDPOINT }} -u userdoesnotmatter -p ${{ secrets.TOKEN }}
docker build . --compress --tag ${{ secrets.TAG }}
docker push ${{ secrets.TAG }}
- name: Deploy container
run: |
CONTAINER_ID=$(sed -e 's/^"//' -e 's/"$//' <<<$(curl -X GET -H "X-Auth-Token: ${{ secrets.TOKEN}}" "https://api.scaleway.com/containers/v1beta1/regions/fr-par/containers/" | jq -e '.containers[] | select(.name|test("${{ secrets.NAME }}"))'.id))
curl \
-X POST \
-H "X-Auth-Token: ${{ secrets.TOKEN }}" \
-d "{}" \
"https://api.scaleway.com/containers/${{ secrets.SCW_API_VERSION }}/regions/fr-par/containers/$CONTAINER_ID/deploy" \
| jq 'del(."environment_variables")'