Skip to content

Commit

Permalink
testing GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoro committed Jan 2, 2024
1 parent a939aa3 commit 62cd7e6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
version: 2.1
parameters:
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Event:
type: string
default: ""
GHA_Meta:
type: string
default: ""

orbs:
ruby: circleci/ruby@2.1.0

Expand Down Expand Up @@ -292,10 +306,12 @@ jobs:
- run:
name: Docker LATEST staging
command: |
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
docker pull $DOCKERHUB_USERNAME/goggles-api:latest
docker build -t $DOCKERHUB_USERNAME/goggles-api:latest --cache-from=$DOCKERHUB_USERNAME/goggles-api:latest -f Dockerfile.staging .
docker push $DOCKERHUB_USERNAME/goggles-api:latest
echo "Git Tag << pipeline.git.tag >>"
echo "GHA_Action << pipeline.parameters.GHA_Action >>"
# echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
# docker pull $DOCKERHUB_USERNAME/goggles-api:latest
# docker build -t $DOCKERHUB_USERNAME/goggles-api:latest --cache-from=$DOCKERHUB_USERNAME/goggles-api:latest -f Dockerfile.staging .
# docker push $DOCKERHUB_USERNAME/goggles-api:latest
docker-versioned:
<<: *common-config
Expand All @@ -311,10 +327,11 @@ jobs:
name: Docker TAGGED prod
command: |
echo "Git Tag << pipeline.git.tag >>"
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
docker pull $DOCKERHUB_USERNAME/goggles-api:latest
docker build -t $DOCKERHUB_USERNAME/goggles-api:prod-<< pipeline.git.tag >> --cache-from=$DOCKERHUB_USERNAME/goggles-api:latest -f Dockerfile.prod .
docker push $DOCKERHUB_USERNAME/goggles-api:prod-<< pipeline.git.tag >>
echo "GHA_Action << pipeline.parameters.GHA_Action >>"
# echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
# docker pull $DOCKERHUB_USERNAME/goggles-api:latest
# docker build -t $DOCKERHUB_USERNAME/goggles-api:prod-<< pipeline.git.tag >> --cache-from=$DOCKERHUB_USERNAME/goggles-api:latest -f Dockerfile.prod .
# docker push $DOCKERHUB_USERNAME/goggles-api:prod-<< pipeline.git.tag >>
workflows:
Expand Down Expand Up @@ -360,7 +377,7 @@ workflows:
# - rspec-T-U

release-docker-latest:
unless: << pipeline.git.tag >>
unless: << pipeline.parameters.GHA_Action >>
jobs:
- persisted-data
- brakeman:
Expand All @@ -375,7 +392,7 @@ workflows:
- zeitwerk

release-docker-versioned:
when: << pipeline.git.tag >>
when: << pipeline.parameters.GHA_Action >>
jobs:
- persisted-data
- brakeman:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: DockerHub Versioned Release
run-name: DockeHub release by ${{ github.actor }}
on:
release:
types: [published]
jobs:
trigger-circleci:
runs-on: ubuntu-latest
steps:
- run: echo "- Branch... ${{ github.ref }}"
- run: echo "- Event.... ${{ github.event_name }}"
- run: echo "- Runner OS ${{ runner.os }} (on GitHub)"
- name: run CircleCI Docker job
id: goggles-api-docker-publish
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.1.0
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}

0 comments on commit 62cd7e6

Please sign in to comment.