Exclude docker-stack-wait
image from docker prune
#97
Workflow file for this run
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 Integration | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
permissions: | |
deployments: write | |
steps: | |
# cloning into "root" does not work when trying to call the action from itself | |
# inspired by Microsoft: https://github.com/microsoft/action-python/blob/c8ec939994d7ed2ec77b7bbe59ed5f5b72fb5607/.github/workflows/test.yml#L21 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: action | |
clean: true | |
- name: Run test server | |
run: | | |
docker compose build | |
docker compose up & | |
working-directory: action | |
- name: Add SSH identity of test server to known hosts | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan -t rsa -p 2222 127.0.0.1 >> ~/.ssh/known_hosts | |
- name: Test | |
uses: ./action | |
with: | |
compose-file: action/docker-compose.test.yml | |
environment: "test" | |
environment-url: "https://www.simplificator.com" | |
secrets: | | |
- name: secret | |
value: ${{ secrets.SECRET }} | |
stack-name: david | |
ssh-user-at-host: [email protected] | |
ssh-port: 2222 | |
- name: Check if test application is available | |
run: | | |
response=$(curl -s 'http://127.0.0.1:8888') | |
if echo "$response" | grep -q "Hello World"; then | |
echo "Pattern matched." | |
exit 0 | |
else | |
echo "Pattern not matched." | |
exit 1 | |
fi | |
shell: bash | |
- name: Check that docker-stack-await image is still there | |
run: | | |
ssh [email protected] docker image inspect sudobmitch/docker-stack-wait:v0.2.5 > /dev/null 2>&1 | |
shell: bash |