Update unit-test.sh #15
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: Docker Image CI | |
on: [push] | |
# Environment variables available to all jobs and steps in this workflow | |
env: # Or as an environment variable | |
docker_username: ${{ github.actor }} | |
docker_password: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
test-code: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Upload workspace | |
uses: actions/upload-artifact@v4 | |
with: | |
name: workspace | |
path: . | |
- name: Test the code | |
run: ./unit-test.sh | |
build-docker-image: | |
runs-on: ubuntu-latest | |
needs: test-code | |
steps: | |
- name: Download workspace | |
uses: actions/download-artifact@v4 | |
with: | |
name: workspace | |
path: . | |
- name: Build the Docker image | |
run: . build-app.sh | |
- name: Login to Docker | |
run: echo "$docker_password" | docker login -u "$docker_username" --password-stdin | |
- name: Push the docker image | |
run: . push-app.sh | |
component-test-docker-image: | |
runs-on: ubuntu-latest | |
needs: build-docker-image | |
steps: | |
- name: Download workspace | |
uses: actions/download-artifact@v4 | |
with: | |
name: workspace | |
path: . | |
- name: Run the component tests | |
run: . component-test.sh | |
working-directory: ./test |