Skip to content

➕Create (last_version.txt) #1

➕Create (last_version.txt)

➕Create (last_version.txt) #1

name: Pull Alpine BaseOS Container -x86_64
on:
push:
paths:
- '.github/workflows/alpine/x86_64/last_version.txt'
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: ✔️ Checkout Repository
uses: actions/[email protected]
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: ⏬ Download Alpine MinirootFS
run: |
URL_BASE="https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/"
OS_VERSION="alpine-minirootfs-"
OS_TYPE="-x86_64"
EXT=".tar.gz"
LAST_VERSION="$(curl -s https://raw.githubusercontent.com/AtomyCloud/docker-images/main/.github/workflows/alpine/x86_64/last_version.txt | tail -n 1)"
URL="${URL_BASE}${OS_VERSION}${LAST_VERSION}${OS_TYPE}${EXT}"
FILE="${OS_VERSION}${LAST_VERSION}${OS_TYPE}${EXT}"
DOCKER_HUB_REPO="atomycloud/os:"
TAG_VERSION="${DOCKER_HUB_REPO}${OS_VERSION}${LAST_VERSION}${OS_TYPE}"
curl -L -O $URL
- name: 🔒️ DockerHub Login
uses: docker/[email protected]
with:
username: ${{secrets.DOCKERHUB_USER}}
password: ${{secrets.DOCKERHUB_PWD}}
- name: 🆗 Import Docker Image, Tag Docker Image && Push Docker Image
run: |
URL_BASE="https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/"
OS_VERSION="alpine-minirootfs-"
OS_TYPE="-x86_64"
EXT=".tar.gz"
LAST_VERSION="$(curl -s https://raw.githubusercontent.com/AtomyCloud/docker-images/main/.github/workflows/alpine/x86_64/last_version.txt | tail -n 1)"
URL="${URL_BASE}${OS_VERSION}${LAST_VERSION}${OS_TYPE}${EXT}"
FILE="${OS_VERSION}${LAST_VERSION}${OS_TYPE}${EXT}"
DOCKER_HUB_REPO="atomycloud/os:"
TAG_VERSION="${DOCKER_HUB_REPO}${OS_VERSION}${LAST_VERSION}${OS_TYPE}"
docker image import "$FILE" "$TAG_VERSION"
docker push "$TAG_VERSION"