Skip to content

Commit

Permalink
CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
j3lte committed Nov 4, 2022
1 parent 8511293 commit 692b832
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Docker Image CI

on:
pull_request:
Expand All @@ -8,9 +8,9 @@ on:
push:
paths-ignore: [ "docs/**" ]


jobs:
pytest:
build:
name: CI Build
runs-on: ubuntu-latest

steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker Image Deployment

on:
push:
tags: ["*.*.*"]
workflow_dispatch:

env:
IMAGE_NAME: debian-torproxy

jobs:
build:
name: Build container image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Login to image-repository , build and push
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- run: |
docker build -f ./Dockerfile . -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest

0 comments on commit 692b832

Please sign in to comment.