Skip to content

Commit

Permalink
Update workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Aug 21, 2024
1 parent 66a108d commit bbbd8d7
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 42 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: DockerHub

on:
push:
branches:
- master
tags:
- 'v*.*.*'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
IMAGE_NAME: index.docker.io/metacall/cli

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to DockerHub
run: docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" -p "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}"

- name: Push MetaCall CLI Docker Image to DockerHub
run: |
docker tag metacall/cli ${{ env.IMAGE_NAME }}:latest
docker push ${{ env.IMAGE_NAME }}:latest
if [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then
TAG=${GITHUB_REF#refs/*/}
VERSION=${TAG#v}
docker tag metacall/cli ${{ env.IMAGE_NAME }}:${VERSION}
docker push ${{ env.IMAGE_NAME }}:${VERSION}
fi
- name: Logout from DockerHub
run: docker logout
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# MetaCall CLI by Parra Studios
# Porable Command Line Interface for MetaCall using Docker.
#
# Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <[email protected]>
# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,6 @@
# limitations under the License.
#

# Create a dependency with MetaCall Core Image in order to trigger Docker Hub builds
FROM metacall/core AS dependency

# TODO: This dependency must be from metacall/distributable
# instead from the core, but it is not automated yet.

# MetaCall CLI Image
FROM alpine:latest

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016-2020 Vicente Eduardo Ferrer Garcia <[email protected]>
Copyright 2016-2024 Vicente Eduardo Ferrer Garcia <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ alias metacall='function mc() { docker run --rm --network host -e "LOADER_SCRIPT

## Build

In case of you want to build it yourself. The `sed` is used to remove unused layer from the Dockerfile. The build is done disabling the cache of the CLI download layer so it always will download the latest version of the CLI.
In case of you want to build it yourself. The build is done disabling the cache of the CLI download layer so it always will download the latest version of the CLI.

```sh
sed 's/FROM metacall/#FROM metacall/' Dockerfile > Dockerfile.build
docker build --build-arg DISABLE_CACHE=`date +%s` -t metacall/cli -f Dockerfile.build .
docker build --build-arg DISABLE_CACHE=`date +%s` -t metacall/cli -f Dockerfile .
```

## Using a Different Version
Expand Down
30 changes: 0 additions & 30 deletions hooks/build

This file was deleted.

0 comments on commit bbbd8d7

Please sign in to comment.