-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (31 loc) · 1.24 KB
/
deps_ytdl-api.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
name: deps_ytdl-api
on:
push:
branches:
paths:
- 'deps/ytdl/api_flask/*'
- '.github/workflows/deps_ytdl-api.yml'
workflow_dispatch:
env:
containerName: ytdl
registryName: mozillareality
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: docker build + push
run: |
#ytdlVer=$(curl https://pypi.org/pypi/youtube_dl/json | jq -r '.info.version')
cd ./deps/ytdl/api_flask
tag="$registryName/$containerName:${GITHUB_RUN_NUMBER}_v$ytdlVer"
echo "[info] tag: $tag"
docker build . -t $tag
echo ${{ secrets.DOCKER_HUB_PWD }} | sudo docker login --username $registryName --password-stdin
sudo docker push $tag
echo "[info] pushing to gcr"
echo "${{ secrets.GCP_HUBS_DEV_SA_JSON_b64 }}" | base64 -d > gcpsakey.json
gcrtag="gcr.io/hubs-dev-333333/$containerName:${GITHUB_RUN_NUMBER}_v$ytdlVer" && echo "[info] gcrtag: $gcrtag"
gcloud auth activate-service-account [email protected] --key-file=gcpsakey.json
gcloud auth configure-docker -q gcr.io
docker tag $tag $gcrtag && docker push $gcrtag