Skip to content

Add github workflows #1

Add github workflows

Add github workflows #1

name: Publish Docker Image
#on:
# release:
# types: [published]
on:
push:
branches: "**"
env:
DOCKER_REPO: ouzielslama/addrindexrsdev
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 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