Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 7 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,27 @@ on:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Decrypt environment variables
run: |
echo "${{ secrets.ENV }}" base64 -d > .env

- name: Run a test
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 }}:80"]}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker

# Because you need to use the hostname set in the harbor, you need to use it if the domain is not assigned.
- name: Set up Harbor hostname
run: |
echo "${{ secrets.HARBOR_REGISTRY }} core.harbor.domain" | sudo tee -a /etc/hosts

- name: Login to Harbor
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY }}:80
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
registry: ${{ secrets.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Push Docker image to Harbor
- name: Push docker image to registry
run: |
docker tag fetch-system/streams:latest ${{ secrets.HARBOR_REGISTRY }}:80/fetch-system/streams:${GITHUB_SHA::7}
docker push ${{ secrets.HARBOR_REGISTRY }}:80/fetch-system/streams:${GITHUB_SHA::7}
docker tag fetch-system/streams:latest ${{ secrets.REGISTRY_DOMAIN }}/fetch-system/streams:${GITHUB_SHA::7}
docker push ${{ secrets.REGISTRY_DOMAIN }}/fetch-system/streams:${GITHUB_SHA::7}

kustomize:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Decrypt environment variables
run: |
echo "${{ secrets.ENV }}" base64 -d > .env

- name: Run a test
run: |
make test-app