-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (46 loc) · 1.5 KB
/
_deploy.yml
File metadata and controls
52 lines (46 loc) · 1.5 KB
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
name: deploy-template
on:
workflow_call:
inputs:
ocir_repository:
required: true
type: string
dockerfile:
required: true
type: string
description: 'Dockerfile path (e.g., api/Dockerfile)'
secrets:
OCI_AUTH_TOKEN:
required: true
DEPLOYER_APP_ID:
required: true
DEPLOYER_APP_PRIVATE_KEY:
required: true
jobs:
deploy:
name: Deploy
runs-on: ubuntu-24.04-arm
env:
IMAGE_TAG: ${{ github.run_number }}
BUILD_NUMBER: ${{ github.run_number }}
OCIR_REGISTRY: yny.ocir.io
OCIR_NAMESPACE: ax1dvc8vmenm
OCIR_REPOSITORY: ${{ inputs.ocir_repository }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to OCIR
run: echo "${{ secrets.OCI_AUTH_TOKEN }}" | docker login $OCIR_REGISTRY -u ax1dvc8vmenm/members/snutt-deployer --password-stdin
- name: Docker build, tag, and push image to OCIR
id: build-push-image
run: |
echo "${{ github.token }}" > .github_token
docker build \
--secret id=github_token,src=./.github_token \
-f ${{ inputs.dockerfile }} \
-t $OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG \
. \
--platform linux/arm64
rm -f .github_token
docker push $OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG
echo "image=$OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT