Skip to content

Commit

Permalink
Merge pull request #5 from Robot-Wranglers/mainline
Browse files Browse the repository at this point in the history
Mainline
  • Loading branch information
mattvonrocketstein authored Mar 14, 2024
2 parents ec11ea5 + 7de81bc commit 2bcb9ca
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
release:
types: [published]
push:
branches: [ "master" ]
paths-ignore:
- '**.md'
- '**.md.j2'
- '**.png'

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Build
run: make build-docker
# - name: Smoke-Test
# run: make smoke-test

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: robot-wranglers/aws-ssm-tool

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: robot-wranglers/aws-ssm-tool:latest,robot-wranglers/aws-ssm-tool:4.2,robot-wranglers/aws-ssm-tool:4.2_2015-02-22
labels: ${{ steps.meta.outputs.labels }}
21 changes: 21 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docker Build
on:
workflow_call: {}
# push:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]
paths-ignore:
- '**.md'
permissions:
contents: read
jobs:
test:
name: Docker Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: make build-docker
# - name: Smoke-Test
# run: make smoke-test
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ pypi-release:
--password $${PYPI_TOKEN} \
dist/*

docker-release: docker-build
echo "docker-release not implemented yet"
docker-build:
echo "docker-build not implemented yet"
DOCKER_IMAGE_NAME ?= aws-ssm-tool

docker-build: build-docker
build-docker:
docker build -t $(DOCKER_IMAGE_NAME) .

release: pypi-release docker-release

Expand Down

0 comments on commit 2bcb9ca

Please sign in to comment.