-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 2.28 KB
/
UpdateAdjustedBaseImage.yaml
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
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/manifests/development/adjustedBaseImage/*'
jobs:
update-worker-image:
name: update ocpu base image if needed
runs-on: ubuntu-latest
permissions:
contents: read
env:
GH_BRANCH: ${{ github.ref_name }}
NAMESPACE: development
GH_SHA: ${{ github.sha }}
APP: opencpu-adjusted
REGISTRY: ${{ secrets.ACR_NAME }}.azurecr.io
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
ref: 'development'
- name: Construct image ref
run: echo "IMAGE_REF=${REGISTRY}/${GITHUB_REPOSITORY,,}/${APP}:$(cat ${APP}/VERSION)" >> $GITHUB_ENV
# - name: Set up kubelogin for non-interactive login
# run: |
# curl -LO https://github.com/Azure/kubelogin/releases/download/v0.0.9/kubelogin-linux-amd64.zip
# sudo unzip -j kubelogin-linux-amd64.zip -d /usr/local/bin
# rm -f kubelogin-linux-amd64.zip
# kubelogin --version
# - name: Install Azure cli
# run: |
# sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg
# curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
# AZ_REPO=$(lsb_release -cs)
# echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
# sudo apt-get update
# sudo apt-get install azure-cli
- name: Azure Login
uses: azure/login@v1
with:
creds: "${{ secrets.AZURE_CREDENTIALS }}"
- name: Connect to Azure Container Registry (ACR)
run: |
az acr login --name ${{ secrets.ACR_NAME }}
- name: Create opencpu adjusted image based on development
if: github.ref_name == 'development' && success()
run: |
DOCKER_BUILDKIT=1 docker build . -t ${{ secrets.ACR_NAME }}.azurecr.io/ocpu/ocpu-base-image:latest-dev \
--file .github/workflows/manifests/${{ env.GH_BRANCH }}/adjustedBaseImage/Dockerfile
docker push ${{ secrets.ACR_NAME }}.azurecr.io/ocpu/ocpu-base-image:latest-dev