Skip to content

Commit

Permalink
Merge pull request #27 from Johnny-Knighten/fix/update-repo-names
Browse files Browse the repository at this point in the history
Fix/update repo names
  • Loading branch information
Johnny-Knighten committed Nov 9, 2023
2 parents 6361f66 + 6c3684d commit ec5be0c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,39 @@ jobs:
with:
dockerfile: "Dockerfile"

- name: Build Docker image
- name: Build Docker image (Push To Cache)
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: johnnyknighten/test:latest
cache-from: type=gha
tags: johnnyknighten/example-github-actions-for-container-release:latest
cache-to: type=gha,mode=max

test:
runs-on: ubuntu-latest
needs:
- lint-and-build
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image (From Cache)
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: johnnyknighten/example-github-actions-for-container-release:latest
cache-from: type=gha

- name: Test the Docker image TEST_VAR equals content of text_content.text
run: docker run --rm johnnyknighten/test:latest -c "cat test_content.txt | grep -q \"Hello World\""
run: docker run --rm johnnyknighten/example-github-actions-for-container-release:latest -c "cat test_content.txt | grep -q \"Hello World\""

- name: Check Nano is installed
run: docker run --rm johnnyknighten/test:latest -c "nano --version"
run: docker run --rm johnnyknighten/example-github-actions-for-container-release:latest -c "nano --version"
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
johnnyknighten/test
johnnyknighten/example-github-actions-for-container-release
tags: |
type=semver,pattern={{version}},value=${{ needs.github-release.outputs.new_version}}
Expand All @@ -98,7 +98,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
johnnyknighten/test
johnnyknighten/example-github-actions-for-container-release
tags: |
type=semver,pattern={{version}},value=${{ needs.github-release.outputs.new_version_dry_run }}
Expand All @@ -110,7 +110,6 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Push Image to Docker Hub (DRY RUN)
if: ${{ env.ACT }}
Expand All @@ -125,6 +124,6 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: johnnyknighten/test
repository: johnnyknighten/example-github-actions-for-container-release
short-description: ${{ github.event.repository.description }}
enable-url-completion: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"repository" : {
"type": "git",
"url": "https://github.com/Johnny-Knighten/dockerhub-plus-semver-ci-test"
"url": "https://github.com/Johnny-Knighten/example-github-actions-for-container-release"
},
"dependencies": {
"semantic-release": "22.0.5",
Expand Down

0 comments on commit ec5be0c

Please sign in to comment.