Skip to content

Commit

Permalink
Merge pull request #659 from iotaledger/feat/ci-job-docker-image
Browse files Browse the repository at this point in the history
Add CI workflow to create and push docker images on release
  • Loading branch information
muXxer authored Jan 15, 2024
2 parents 53d8886 + 92e95a9 commit de71160
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
release:
types: [published]

jobs:
docker:
name: Release Docker
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
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

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: iotaledger/iota-core
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=match,pattern=v(\d+.\d+),suffix=-alpha,group=1,enable=${{ contains(github.ref, '-alpha') }}
type=match,pattern=v(\d+.\d+),suffix=-beta,group=1,enable=${{ contains(github.ref, '-beta') }}
type=match,pattern=v(\d+.\d+),suffix=-rc,group=1,enable=${{ contains(github.ref, '-rc') }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}

- name: Build and push to Dockerhub
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ LABEL org.label-schema.name="iotaledger/iota-core"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.vcs-url="https://github.com/iotaledger/iota-core"

RUN mkdir /scratch /app
# Ensure ca-certificates are up to date
RUN update-ca-certificates

# Set the current Working Directory inside the container
RUN mkdir /scratch
WORKDIR /scratch

COPY . .
# Prepare the folder where we are putting all the files
RUN mkdir /app

# Ensure ca-certificates are up to date
RUN update-ca-certificates
WORKDIR /scratch

# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .

# Download go modules
RUN go mod download
Expand Down
2 changes: 1 addition & 1 deletion components/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
Name = "iota-core"

// Version of the app.
Version = "0.1.0"
Version = "1.0.0-alpha.1"
)

func App() *app.App {
Expand Down

0 comments on commit de71160

Please sign in to comment.