Skip to content

Update download path #25

Update download path

Update download path #25

name: Build, Test and Publish
on:
push:
tags:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Create Directories
run: |
mkdir ./ext /tmp/storedDockerImages
- name: Build Docker Image
run: |
docker build -t ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF##*/} .
- name: Pack Docker Image
run: |
docker save ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF##*/} > /tmp/storedDockerImages/${GITHUB_REF##*/}.tar
- name: Upload Artifact
uses: actions/upload-artifact@main #https://github.com/actions/upload-artifact
with:
name: storedDockerImages
path: /tmp/storedDockerImages
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@main #https://github.com/actions/download-artifact
with:
name: storedDockerImages
path: /tmp/storedDockerImages
- name: Load Docker Image
run: |
docker load < /tmp/storedDockerImages/${GITHUB_REF##*/}.tar
- name: Run Test Project
run: |
docker run -i --rm \
-v ${PWD}/test:/opt/soapui/projects \
-v ${PWD}/test/reports:/opt/soapui/projects/reports \
ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF##*/} -r -j -J \
-f /opt/soapui/projects/reports \
-I /opt/soapui/projects/TestProject-soapui-project.xml
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v3 #https://github.com/marketplace/actions/checkout
- name: Download Artifacts
uses: actions/download-artifact@main #https://github.com/actions/download-artifact
with:
name: storedDockerImages
path: /tmp/storedDockerImages
- name: Load Docker Image
run: |
docker load < /tmp/storedDockerImages/${GITHUB_REF##*/}.tar
- name: Add Latest Tag To Docker Image
run: |
docker tag ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF##*/} ghcr.io/${GITHUB_REPOSITORY}:latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v2 #https://github.com/marketplace/actions/docker-login
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker Image with Reference Tag
run: |
docker push ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF##*/}
- name: Push Docker Image with Latest Tag
run: |
docker push ghcr.io/${GITHUB_REPOSITORY}:latest