mirror of
https://github.com/iterate-ch/cyberduck.git
synced 2026-05-26 19:10:49 +00:00
Workflow to create docker image for duck.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
name: Create duck image
|
||||
on:
|
||||
push:
|
||||
tags: ['*']
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Sanitize Version
|
||||
run: |
|
||||
export VERSION=${GITHUB_REF#refs/tags/release-}
|
||||
export VERSION=${VERSION//-/.}
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{env.VERSION}}
|
||||
type=semver,pattern={{major}}.{{minor}},value=${{env.VERSION}}
|
||||
type=semver,pattern={{major}},value=${{env.VERSION}}
|
||||
- name: Set up JDK 15
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 15
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
export COUNT=$(git rev-list --count $GITHUB_SHA)
|
||||
mvn -B verify --projects cli/linux --also-make -DskipTests
|
||||
dpkg-deb -R cli/linux/target/release/duck_${{env.VERSION}}.$COUNT-1_amd64.deb .
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -0,0 +1,6 @@
|
||||
FROM ubuntu:focal
|
||||
ENTRYPOINT ["/usr/bin/duck"]
|
||||
CMD ["--version"]
|
||||
|
||||
COPY opt/duck /opt/duck
|
||||
RUN ln -s /opt/duck/bin/duck /usr/bin/duck
|
||||
Reference in New Issue
Block a user