Skip to content

Commit

Permalink
Merge pull request #581 from hoang-himself/ci
Browse files Browse the repository at this point in the history
Tweak some CI workflows
  • Loading branch information
digininja authored Sep 1, 2023
2 parents 19d7cac + c7717c5 commit cb18921
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
name: Docker Image CI

on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
branches: [master]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
Expand All @@ -29,8 +25,12 @@ jobs:
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
COMMIT=$(echo "${{ github.sha }}" | cut -c 1-7)
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --tag dvwa
docker tag dvwa $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
echo COMMIT=$COMMIT
docker image build --tag dvwa .
docker image tag dvwa $IMAGE_ID:$VERSION
docker image tag dvwa $IMAGE_ID:$COMMIT
docker image push $IMAGE_ID:$VERSION
docker image push $IMAGE_ID:$COMMIT
6 changes: 5 additions & 1 deletion .github/workflows/shiftleft-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
name: SL Scan

# This section configures the trigger for the workflow. Feel free to customize depending on your convention
on: push
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
Scan-Build:
Expand Down

0 comments on commit cb18921

Please sign in to comment.