.github/workflows/docker-build-dev.yml
name: Build Dev Image
on:
push:
branches:
- main
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: 🔍 Checkout code
uses: actions/checkout@v2
- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: 🔑 Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 🎃 Set up outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: ⚓ Build and push
uses: docker/build-push-action@v2
with:
context: .
file: .devcontainer/Dockerfile
pull: true
push: true
build-args: |
VARIANT=3.0-bullseye
NODE_VERSION=14
cache-from: type=registry,ref=mashirozx/mastodon:dev
cache-to: type=inline
tags: |
mashirozx/mastodon:dev
mashirozx/mastodon:dev-${{steps.vars.outputs.sha_short}}