Merge pull request #41 from Goboolean/feature/cicd #3
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: Continuous Delivery | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Decrypt environment variables | |
run: | | |
echo "${{ secrets.ENV }}" > deploy/.env | |
- name: Run tests | |
run: | | |
make test-app | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Decrypt environment variables | |
run: | | |
echo "${{ secrets.ENV }}" base64 -d > .env | |
- name: Build an app | |
run: | | |
make build-app | |
- name: Set up Docker daemon to using HTTP | |
run: | | |
sudo mkdir -p /etc/docker | |
echo '{"insecure-registries":["${{ secrets.HARBOR_REGISTRY }}"]}' | sudo tee /etc/docker/daemon.json | |
sudo systemctl restart docker | |
- name: Login to Harbor | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.HARBOR_REGISTRY }} | |
username: ${{ secrets.HARBOR_USERNAME }} | |
password: ${{ secrets.HARBOR_PASSWORD }} | |
- name: Push Docker image to Harbor | |
run: | | |
docker tag fetch-system-worker:latest ${{ secrets.HARBOR_REGISTRY }}/fetch-system/fetch-system-worker:${{ github.sha }} | |
docker push ${{ secrets.HARBOR_REGISTRY }}/fetch-system/fetch-system-worker:${{ github.sha }} | |
kustomize: | |
runs-on: ubuntu-latest | |
needs: build | |
# Kustomize repository update workflow | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 |