Skip to content

Commit

Permalink
Add new and update existing github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-zelenku committed Jan 6, 2024
1 parent 94c67a4 commit fec50ae
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 18 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/dependabot-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: dependabot validator

on:
pull_request:
paths:
- '.github/dependabot.yml'
- '.github/workflows/dependabot-validator.yml'
jobs:
test:
name: verify-dependabot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: marocchino/validate-dependabot@v2
id: validate
- uses: marocchino/sticky-pull-request-comment@v2
if: always()
with:
header: validate-dependabot
message: ${{ steps.validate.outputs.markdown }}
41 changes: 26 additions & 15 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,31 @@ jobs:
name: build-docker-image
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3
- name: install buildx
- name: Prepare
run: |
tag=$(echo "${{ github.ref }}" | cut -d "/" -f3)
echo "NEW_TAG=${tag}" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
version: latest
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image
run: |
NEW_TAG=$(echo "${{ github.ref }}" | cut -d "/" -f3)
echo "Docker image tag: ${NEW_TAG}"
docker buildx build --push \
--tag torilabs/ipsec-prometheus-exporter:latest \
--tag torilabs/ipsec-prometheus-exporter:${NEW_TAG} \
--platform linux/amd64,linux/arm/v7,linux/arm64 .
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: torilabs/ipsec-prometheus-exporter:latest,torilabs/ipsec-prometheus-exporter:${{ env.NEW_TAG }}
20 changes: 20 additions & 0 deletions .github/workflows/dockerfile-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: dockerfile validator

on:
pull_request:
paths:
- 'Dockerfile'
- '.github/workflows/dockerfile-validator.yml'

jobs:
test:
name: verify-dockerfile
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Verify Dockerfile
uses: ghe-actions/dockerfile-validator@v1
with:
dockerfile: 'Dockerfile'
lint: 'dockerlint'
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ '*' ]

jobs:
linting:
test:
name: linting
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ '*' ]

jobs:
test:
Expand Down

0 comments on commit fec50ae

Please sign in to comment.