-
Notifications
You must be signed in to change notification settings - Fork 123
67 lines (63 loc) · 2.17 KB
/
base-build.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
60
61
62
63
64
65
66
67
name: Build base images
on:
workflow_dispatch:
pull_request:
branches:
- dev
permissions:
id-token: write
contents: write
jobs:
build-and-push:
runs-on: ubuntu-latest
environment: build
strategy:
matrix:
include:
- dockerfile: Dockerfile-services-base
image-name: services-base
- dockerfile: Dockerfile-worker-base
image-name: worker-base
steps:
- uses: actions/checkout@v4
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Build and push image'
run: |
echo noop
update-tags:
# needs: build-and-push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.WORKFLOW_KEY }}
- name: 'Update tags'
run: |
TAG=${{ github.run_id }}
sed -i "s|\(\s\+image.*:\).*|\1${TAG}|" ./.github/workflows/lint-test.yml
sed -i "s|\(FROM.*:\).*|\1${TAG}|" ./resources/docker/Dockerfile-api_orchestrator
sed -i "s|\(FROM.*:\).*|\1${TAG}|" ./resources/docker/Dockerfile-cache
sed -i "s|\(FROM.*:\).*|\1${TAG}|" ./resources/docker/Dockerfile-worker
sed -i "s|\(FROM.*:\).*|\1${TAG}|" ./resources/docker/Dockerfile-devcontainer
- name: Commit changes
run: |
git remote -v
git remote set-url origin git@github.com:microsoft/farmvibes-ai.git
git remote -v
mkdir -p ~/.ssh/
echo ${{ secrets.WORKFLOW_KEY }} >> ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
git config --global user.email "farmvibesaicd@microsoft.com"
git config --global user.name "FarmVibes.AI Release Pipeline"
BRANCH=update-base-${{ github.run_id }}
git checkout -b $BRANCH
git add ./.github/workflows/lint-test.yml
git add ./resources/docker/
git commit -m "Update base tag to latest image"
git push --set-upstream origin $BRANCH