71 lines
1.5 KiB
YAML
71 lines
1.5 KiB
YAML
name: Build, push and deploy Docker image
|
|
|
|
on:
|
|
- push
|
|
|
|
# Enables BuildKit
|
|
env:
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
jobs:
|
|
|
|
build-front:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: "Build and push front image"
|
|
uses: docker/build-push-action@v1
|
|
with:
|
|
dockerfile: front/Dockerfile
|
|
path: front/
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
repository: thecodingmachine/workadventure-front
|
|
tag_with_ref: true
|
|
add_git_labels: true
|
|
|
|
build-back:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: "Build and push back image"
|
|
uses: docker/build-push-action@v1
|
|
with:
|
|
dockerfile: back/Dockerfile
|
|
path: back/
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
repository: thecodingmachine/workadventure-back
|
|
tag_with_ref: true
|
|
add_git_labels: true
|
|
|
|
deeploy:
|
|
needs:
|
|
- build-front
|
|
- build-back
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
# Create a slugified value of the branch
|
|
- uses: rlespinasse/github-slug-action@master
|
|
|
|
- name: Deploy
|
|
uses: thecodingmachine/deeployer@master
|
|
env:
|
|
KUBE_CONFIG_FILE: ${{ secrets.KUBE_CONFIG_FILE }}
|
|
with:
|
|
namespace: workadventure-${{ env.GITHUB_REF_SLUG }}
|