Shumicon 2023: New event #313
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: cicd | |
on: | |
push: | |
branches: | |
- development | |
- master | |
pull_request: | |
branches: | |
- development | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
env: | |
DOCKER_BUILDKIT: "1" | |
COMPOSE_DOCKER_CLI_BUILD: "1" | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: docker/setup-buildx-action@v1 | |
- run: docker-compose -f docker-compose.test.yml up --exit-code-from test | |
build: | |
runs-on: ubuntu-20.04 | |
if: ${{ github.event_name == 'push' }} | |
env: | |
SKAFFOLD_DEFAULT_REPO: ghcr.io/con2 | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- uses: pairity/setup-cd-tools@30acb848f9ff747aff4810dac40c5cc0971f485d | |
with: | |
skaffold: '1.20.0' | |
- uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USERNAME }} | |
password: ${{ secrets.GHCR_PASSWORD }} | |
- uses: docker/setup-buildx-action@v1 | |
- id: build | |
run: | | |
python3 -m pip install emskaffolden | |
emskaffolden -E staging -- build --file-output build.json | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: build-json | |
path: build.json | |
# TODO DRY | |
deploy_staging: | |
runs-on: self-hosted | |
needs: build | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: build-json | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- uses: pairity/setup-cd-tools@30acb848f9ff747aff4810dac40c5cc0971f485d | |
with: | |
kubectl: '1.20.4' | |
skaffold: '1.20.0' | |
- uses: docker/setup-buildx-action@v1 | |
- run: | | |
python3 -m pip install emskaffolden | |
emskaffolden -E staging -- deploy -n kompassi-staging -a build.json | |
deploy_production: | |
runs-on: self-hosted | |
needs: build | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: build-json | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- uses: pairity/setup-cd-tools@30acb848f9ff747aff4810dac40c5cc0971f485d | |
with: | |
kubectl: '1.20.4' | |
skaffold: '1.20.0' | |
- uses: docker/setup-buildx-action@v1 | |
- run: | | |
python3 -m pip install emskaffolden | |
emskaffolden -E production -- deploy -n kompassi-production -a build.json |