Skip to content

include repo dep

include repo dep #4

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
env:
IMAGE_NAME: ghcr.io/cloudacademy/lab-dev-env
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout lab repository
uses: actions/checkout@v4
with:
repository: cloudacademy/labs-cli
path: labs-cli
token: ${{ secrets.GH_TOKEN }}
- name: Checkout helper repository
uses: actions/checkout@v4
with:
repository: cloudacademy/labs-cli-helpers
path: labs-cli-helpers
token: ${{ secrets.GH_TOKEN }}
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.sha_short }}