Skip to content

Commit

Permalink
publish Docker image on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Mar 18, 2024
1 parent 1173cef commit 941f07c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Docker Image

on:
push:
branches: ["docker"]

#on:
# release:
# types: [published]

env:
DOCKER_REPO: ouzielslama/counterpartydev
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME_TEST }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD_TEST }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Docker
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
- name: Build, tag, login and push image
run: |
export VERSION=v$(cat counterparty-lib/counterpartylib/lib/config.py | grep '__version__ =' | awk -F '"' '{print $2}')
docker build -t $DOCKER_REPO:$VERSION .
docker tag $DOCKER_REPO:$VERSION $DOCKER_REPO:latest
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
docker push $DOCKER_REPO:$VERSION

0 comments on commit 941f07c

Please sign in to comment.