Skip to content

Move Docker image files to docker subdirectory #5

Move Docker image files to docker subdirectory

Move Docker image files to docker subdirectory #5

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ main ]
env:
RELEASING: ${{ startsWith(github.ref, 'refs/tags/') }}
DOCKERHUB_REPO: tenacom/buildvana-builder
TEST_TAG: tenacom/buildvana-builder:test
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate Docker mrepository metadata
id: meta
if: ${{ env.RELEASING }}
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_REPO }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and load into Docker
uses: docker/build-push-action@v5
with:
context: ./docker
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: Build and push
if: ${{ env.RELEASING }}
uses: docker/build-push-action@v5
with:
context: ./docker
push: ${{ env.RELEASING }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}