Skip to content

Commit

Permalink
Merge pull request #19 from CounterpartyXCP/docker
Browse files Browse the repository at this point in the history
Add github workflows
  • Loading branch information
adamkrellenstein authored Mar 18, 2024
2 parents bb5a300 + d13628b commit ed1ef0a
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Report a bug
about: Report incorrect or unexpected behavior.
title: ''
labels: bug
assignees: adamkrellenstein

---

**Describe the Problem**
A clear and concise description of what the problem is. What was the expected behavior?

**Steps To Reproduce**
Steps to reproduce the behavior:
1. ...

**Screenshots and Logfiles**
If applicable, upload screenshots and logfiles to help explain your problem. Please run everything with the `--verbose` flag when possible.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Request a feature
about: Suggest an improvement!
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
21 changes: 21 additions & 0 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build Docker Image

on:
push:
branches: "**"

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 image
run: |
docker build -t addrindexrs .
- name: Test image
run: |
docker run --rm addrindexrs -h
28 changes: 28 additions & 0 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Docker Image

on:
release:
types: [published]

env:
DOCKER_REPO: counterparty/addrindexrs
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

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 Cargo.toml | 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
docker push $DOCKER_REPO:latest

0 comments on commit ed1ef0a

Please sign in to comment.