B4nner Challenge | SlyPex #3
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: Challenges Build Test | |
run-name: ${{ github.head_ref }} Challenge | ${{ github.event.pull_request.user.login }} | |
on: | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
test: | |
name: 'Test Challenge Structure' | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Python Setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11.7' | |
- name: Test Challenge directory structure | |
run: .github/scripts/chall_structure_validator.py ${{github.head_ref}} | |
test_dockerfile: | |
name: 'Check Dockerfile Existance' | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
needs: test | |
if: success() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: 'Dockerfile Existance' | |
run : .github/scripts/dockerfile_checker.sh ${{ github.head_ref }} | |
test_docker_compose: | |
name: 'Check Docker Compose Existance' | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
needs: test | |
if: success() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: 'Docker Compose Existance' | |
run : .github/scripts/docker_compose_checker.sh ${{ github.head_ref }} | |
build_dockerfile: | |
name: 'Build Challenge Container using Dockerfile' | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
needs: test_dockerfile | |
if: success() | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
push: false | |
tags: ${{github.repository_owner}}/${{github.head_ref}}:latest | |
build_docker-compose: | |
name: 'Build Challenge Container using Docker Compose' | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
needs: test_docker_compose | |
if: success() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Docker Compose Challenge Deployment | |
uses: hoverkraft-tech/[email protected] | |
with: | |
compose-file: ${{ github.head_ref }}/docker-compose.yml | |
up-flags: "--build" | |
- name: Test Challenge | |
run: docker ps -a |