feat: add button download outputs #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Sapa Mitra Frontend (Staging Mode) | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: ["closed"] | |
branches: ["main"] | |
jobs: | |
build: | |
if: github.event_name == 'push' || github.event.pull_request.merged == true | |
name: Build Frontend (Staging Mode) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- 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: docker login ${{ secrets.DOCKER_REGISTRY_URL }} --username=${{ secrets.DOCKER_REGISTRY_USERNAME }} --password=${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
- name: Build and Push Docker Image | |
run: | | |
docker build --build-arg BUILD_HASH=$(git rev-parse --short HEAD) --no-cache -t sapa-mitra-frontend-staging -f Dockerfile.staging . | |
docker tag sapa-mitra-frontend-staging ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REGISTRY_USERNAME }}/sapa-mitra-frontend-staging:latest | |
docker push ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REGISTRY_USERNAME }}/sapa-mitra-frontend-staging:latest |