Merge pull request #129 from atlanticwave-sdx/128.update-mongodb #46
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
# A workflow to build and publish sdx-controllera container images. | |
# See https://docs.docker.com/build/ci/github-actions/. | |
name: Container images | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "*" | |
# # Triggering the build/publish of container images on pull | |
# # requests should be here only for testing, keep "pull_request" | |
# # disabled. | |
# pull_request: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Collect metadata for container image tags | |
# See https://github.com/docker/metadata-action | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
awsdx/sdx-lc | |
# ghcr.io/username/app | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=pep440,pattern={{version}} | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
# Secrets used here are set under "repository secrets" at | |
# https://github.com/atlanticwave-sdx/sdx-controller/settings/secrets/actions, | |
# | |
# # See https://github.com/docker/login-action. | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Buildx is a Docker CLI plugin for extended build capabilities | |
# with BuildKit. | |
# | |
# See https://github.com/docker/setup-buildx-action. | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# See https://github.com/docker/build-push-action | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
awsdx/sdx-lc:latest | |
${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |