Skip to content

Commit

Permalink
feature/github-actions-integration (#32)
Browse files Browse the repository at this point in the history
* Testing github workflow

* Updated/moved action file

* Small syntax change

* Please show up on PR

* Quick Actions test

* Quick Actions test 2

* Quick Actions test 3

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Actions Job Checkout Test

* Install Task

* Install precommit

* Install precommit

* Testing Docker build

* Testing Docker build

* Testing Docker build

* Testing Docker build

* Testing Docker build

* Testing test job

* Testing test job

* Testing test job

* Testing Docker Layer Caching

* Testing Docker Layer Caching and Secure

* Testing Secure

* Testing Validate Stage

* Testing Validate Stage

* Testing Validate Stage

* Testing Validate Stage

* Testing Validate Stage

* Testing hadolint

* Testing hadolint

* Testing hadolint

* Testing Validate stage

* Clean-up

* More clean-up

* Dockerfile clean-up

* Dockerfile test

* Checkout Action Test

* Checkout Action Test

* Unit Test - Final Test

* Demo Time

* Codefresh removal

* Codefresh removal

* Comment clean-up

* Remove entrypoint and see what breaks

* Use task to build; test w/ local tag

* Run setup before task

* Revert changes

* Task to build with latest tag

* Local tag

* Testing local build with Entrypoint

* Run test in same job as build

* Change Test job name

* Clean-up

* Added a release workflow to push image to Docker Hub

* Added published release to trigger events

* Re-run

* Added prereleased to trigger

* Removed checkout phase in deliver job

* Updated context

* Added release edited as a trigger

* Context to file

* Added context and file

* Trying a deeper context

* Changed image to local

* Sanity check

* Revert image

* Updated context and file

* Removed context

* Completely removed context

* Changed file and context

* Bring back checkout

* Changed tags

* Image update

* Retry initial tags

* Adding Buildx Action

* Fixed image name

* Rearrange maybe

* Rerun

* Changed tags

* Try with release

* Add release trigger

* Removing metadata and changing tag to latest

* Remove previous steps

* Remove dependencies for deliver stage

* Adding ghcr prefix to tag

* Changed context and reverted tag

* Bring back metadata and try with new context

* Removing the checkout

* Revert checkout and change image name

* Use QEMU and remove metadata

* Log in before extract

* Removed buildx action and changed image

* Add buildx

* Buildx after login

* Using all actions

* Remove metadata

* Try without checkout

* Test wrong image

* Using new image

* Rearrange

* Bring back checkout and context

* Moved buildx

* Remove tag trigger

* Added debug to buildx action

* Removed context

* Removed buildx

* Last try for tonight

* Try a different action

* Manual push to Docker Hub

* Manual

* Manual again

* Manual once again

* Adjusted image name

* Using Docker Login Action

* Added tag to push

* Changed build command

* Manual login

* Revert to 401 status

* Added buildx

* Empty

* Updated docker spec

* Docker version

* Clean-up

Co-authored-by: Staton <statonb@saic.com>
  • Loading branch information
shawju and saic-statonb authored Oct 19, 2021
1 parent 8ac1bf7 commit 2f5c286
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: pull-request

on: [pull_request]

jobs:
validate:
runs-on: ubuntu-latest
name: Validate
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run asdf
uses: asdf-vm/actions/install@v1
- name: Run hadolint
uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ./src/docker/Dockerfile
- name: Run pre-commit
uses: pre-commit/action@v2.0.3

test:
runs-on: ubuntu-latest
needs: validate
name: Build Docker Image and Run Unit Tests
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Docker Layer Caching
uses: satackey/action-docker-layer-caching@v0.0.11
- name: Setup Task
uses: arduino/setup-task@v1
- name: Build the Docker Image
run: task build TAG=local
- name: Run Unit Tests
run: task test TAG=local
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
release:
types: [published]

jobs:
deliver:
runs-on: ubuntu-latest
name: Deliver to Docker Hub
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Extract Metadata (tags & labels)
id: meta
uses: docker/metadata-action@v3
with:
images: saicoss/anvil
- name: Build and Push to Dockerhub
uses: docker/build-push-action@v2
with:
context: .
file: src/docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ repos:
rev: v2.3.2
hooks:
- id: prettier
- repo: https://github.com/jas-on/pre-commit-hadolint
rev: 1.0.1
hooks:
- id: hadolint
2 changes: 1 addition & 1 deletion spec/docker_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Describe "printVersion()"
printVersion() {
docker --version | grep "${DOCKER_VERSION}"
dnf list docker-ce | grep "${DOCKER_VERSION}"
}

It "validates tool is installed by checking version"
Expand Down

0 comments on commit 2f5c286

Please sign in to comment.