-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.43 KB
/
staging.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
name: CI/CD Serambi Kami (Staging Mode)
on:
push:
branches: ["staging"]
jobs:
build:
if: github.event_name == 'push'
name: Build Serambi Kami (Staging Mode)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Insecure Docker Repository
run: |
sudo truncate -s-2 /etc/docker/daemon.json
echo ", \"insecure-registries\": [\"${{ secrets.DOCKER_REGISTRY_URL }}\"]}" | sudo tee -a /etc/docker/daemon.json
sudo systemctl restart docker
- name: Docker Auth
run: |
echo "${{ secrets.DOCKER_REGISTRY_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY_URL }} --username ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
- name: Extract version and short commit hash
run: |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build Docker Image
run: |
docker build \
--build-arg BUILD_HASH=$SHORT_SHA \
-f Dockerfile.staging \
-t ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REGISTRY_USERNAME }}/serambi-kami:latest \
.
- name: Push Docker Image
run: |
docker push ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REGISTRY_USERNAME }}/serambi-kami:latest